<?php
header('Content-Type: text/html; charset=UTF-8');
if(!defined('INC_PATH')){
	define("INC_PATH","../../../");
}
require_once(INC_PATH."lib_new/db.php");
$error = "null";
$ticket_count = 0;
// 会員ログインの検証（Cookie）
if(($_COOKIE["sav_memberid"] == "")||
   ($_COOKIE["sav_password"] == "")) {
  $memberid = "";
  $error = "ログインしていないです";
}
else {
  $memberid = $_COOKIE["sav_memberid"];
}
// 会員メアド取得
if($memberid != "") {
	$con = con_open();
	$sql = "SELECT * FROM member WHERE memberid=" . $memberid ." AND regularflg=1";
	$res = pg_query($con, $sql);
	if($res){
		$ticket_count = pg_fetch_result($res, "fukubiki");
	}
	con_close($con);
}
echo '
Var.set(selfNum,'.$ticket_count.');
Var.set(txt_index,'.rand(0,14).');
';
?>